package study.spring.core.ioc._3_bean_assemble.multiimpl;

import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AssembleClass {

  /**
   * 一个接口有两个实现类, 如何不冲突的调用两个实现类
   * <p>
   * 组装一个 Map 属性
   */
  @Autowired
  private Map<String, ImplementedInterface> map;

  public void testMultiImpl() {
    for (String key : map.keySet()) {
      ImplementedInterface multiImpl = map.get(key);
      multiImpl.test();
    }
  }
}
